import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

let app = createApp(App);
// 引入路由
import router from "@/router";
app.use(router)
// 引入UI样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'  // 引入中文包
app.use(ElementPlus,{
  locale: zhCn
})

// 引入字体图标库
import "@/assets/fonts/iconfont.js";

// 引入svg组件
import SvgIcon from "@/components/SvgIcon.vue";
// 注册全局组件
app.component("SvgIcon", SvgIcon);

import * as ElementPlusIconsVue from '@element-plus/icons-vue'  // 引入字体图标UI

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 实例化仓库
import { createPinia } from "pinia";
app.use(createPinia());

// console.log("环境变量",import.meta.env.VITE_BASE_URL);  // /api /pro
// 引入dataV
import DataVVue3 from '@kjgl77/datav-vue3'
app.use(DataVVue3)  // 注入dataV

// 引入路由守卫的permission的权限文件
import "./permission.ts"

app.mount('#app')
